"""
Case Type   : 服务端工具
Case Name   : omm用户检查操作系统信息
Create At   : 2020/12/24
Owner       : opentestcase002
Description :
    omm用户检查操作系统信息
Expect      :
    执行成功
History     :
    modified by lonely-dance at 2025/9/10: 修改期望 
"""
import unittest
from yat.test import Node
from yat.test import macro
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger

logger = Logger()


class Tools(unittest.TestCase):
    def setUp(self):
        logger.info('--------------Opengauss_Function_Tools_gs_checkos_Case0073start-------------------')
        self.dbuserNode = Node('dbuser')
        self.Constant = Constant()

    def test_server_tools1(self):
        logger.info('------------------omm用户检查操作系统信息------------------')
        checkos_cmd = f'''
                                    source {macro.DB_ENV_PATH}
                                    gs_checkos  -i A
                                    '''
        logger.info(checkos_cmd)
        msg = self.dbuserNode.sh(checkos_cmd).result()
        logger.info(msg)
        self.assertIn('Total numbers:8. Abnormal numbers:0.',msg)

    def tearDown(self):
        logger.info('--------------无需清理环境-------------------')
        logger.info('------------------Opengauss_Function_Tools_gs_checkos_Case0073finish------------------')
